<template>
  <!-- 视频框 -->
  <div class="videoBar">
    <template v-for="(item, index) in widgetData.value">
      <div class="video" :id="type=='waterfall'?item.siteId:''" :key="index">
        <!-- 热力图 -->
        <template v-for="(ele,idx) in mapData">
          <div v-if="ele.sitePageId == item.siteId" :key="idx+'a'" class="mark"
            :style="{background:`#${ele.color}`,opacity:0.9}">
            <div>
              <div class="name">PV：{{ele.exposurePv}}</div>
              <div class="name">UV：{{ele.exposureUv}}</div>
            </div>
            <div class="level">Lv.{{ele.level}}</div>
          </div>
        </template>
        <!-- 组件 -->
        <div class="cont"></div>
      </div>
    </template>
  </div>
</template>

<script>
export default {
  name: "videoBar",
  props: {
    type: {
      type: String,
      default: 'widget'
    },
    widgetData: {
      type: Object,
      required: true
    },
    // 热力图
    mapData:{
      type: Array,
      default: () => []
    }
  },
  data () {
    return {
      
    }
  },
  methods: {},
}
</script>

<style lang="less" scoped>
.videoBar {
  width: 100%;
  height: 100%;
  .video{
    width: 100%;
    height: 100%;
    position: relative;
    // 热力图
    .mark{
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      padding: 10px 15px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .name{
        color: #ffffff;
      }
      .level{
        color: #ffffff;
        text-align: right;
      }
    }
  }
  .cont{
    background-color: #000000;
    width: 100%;
    height: 100%;
  }
  // 锚点定位
  .anchor{
    box-shadow: 1px 1px 10px 10px red;
  }
}
</style>